﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PSSMS.View.SysManage
{
    /// <summary>
    /// StaffSM.xaml 的交互逻辑
    /// </summary>
    public partial class StaffSM : UserControl
    {
        BLL.Staffsm.StaffsmClient myClient = new BLL.Staffsm.StaffsmClient();
        //实例化表格：接收筛选数据
        DataTable dtNew = new DataTable();
        public StaffSM()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 新增员工
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StAddClick(object sender, RoutedEventArgs e)
        {
            StaffAdd stAdd = new StaffAdd();
            stAdd.Show();
        }
        /// <summary>
        /// 用户控件加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Staffsm_Loaded(object sender, RoutedEventArgs e)
        {
            //查询员工信息
            Staffsm();
        }

        private void Staffsm()
        {
            //调用服务查询方法
            dtNew = myClient.CheckProvidersm().Tables[0];
            DgrdModel.ItemsSource = dtNew.DefaultView;
        }
    }
}
